package com.aiyige.page.globalsearch.adapter;

import android.view.View;
import android.widget.TextView;

import com.aiyige.R;
import com.aiyige.page.globalsearch.model.HistoryHotItem;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.LinkedList;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by zhuyakun on 2017/12/8.
 */

public class HistoryHotAdapter extends BaseQuickAdapter<HistoryHotItem, HistoryHotAdapter.ViewHolder> {

    public HistoryHotAdapter() {
        super(R.layout.history_hot_search_item, new LinkedList<HistoryHotItem>());
    }

    @Override
    protected void convert(ViewHolder helper, HistoryHotItem item) {
        helper.bindData(item);
    }

    public class ViewHolder extends BaseViewHolder {
        @BindView(R.id.itemTv)
        TextView itemTv;

        public ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }

        public void bindData(HistoryHotItem item) {
            itemTv.setText(item.getSearchStr());
        }
    }

}
